package com.weilus.dto.response;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * @program test-springBoot
 * @date 2019-07-27 15:14
 **/
public class BootstrapTablePage {
    /**
     * 总数
     */
    private long total;
    /**
     * 结果集
     */
    @JacksonXmlElementWrapper(localName = "rows")
    @JacksonXmlProperty(localName = "row")
    private List<Object> rows;

    public BootstrapTablePage(){

    }
    public BootstrapTablePage(Page page){
        this.rows = page.getResult();
        this.total = page.getTotal();
    }
    public BootstrapTablePage(PageInfo page){
        this.rows = page.getList();
        this.total = page.getTotal();
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public List<Object> getRows() {
        return rows;
    }

    public void setRows(List<Object> rows) {
        this.rows = rows;
    }
}
